import time

import pyautogui

size = pyautogui.size()
print(size)

mouse_pos = pyautogui.position()
print(mouse_pos)

print(pyautogui.onScreen(100, 100))

pyautogui.moveTo(10, 10, duration=0.1)
pyautogui.moveTo(size.width / 2, size.height / 2, 1)

pyautogui.moveRel(100, 0, duration=0.1)

last_pos = pyautogui.position()

try:
    while True:
        new_pos = pyautogui.position()
        if last_pos != new_pos:
            print(new_pos)
            last_pos = new_pos
        time.sleep(0.1)

except KeyboardInterrupt:
    print('\nExit')
